package itcz.example.pattern.behavior_type.observer;

/**
 * @ClassName: Client
 * @Author: ITCZ
 * @Date: 2025-07-30
 * @Description:
 */
public class Client {
    public static void main(String[] args) {
        SubscriptionSubject subject = new SubscriptionSubject();
        // 注册观察者
        Observer weixinUser1 = new WeixinUser("张三");
        Observer weixinUser2 = new WeixinUser("李四");
        Observer weixinUser3 = new WeixinUser("王五");
        subject.attach(weixinUser1);
        subject.attach(weixinUser2);
        subject.attach(weixinUser3);

        subject.notify("关注的公众号有更新了");
    }
}
